package cc.uncarbon.module.appapi.web.app;

import cc.uncarbon.framework.web.model.response.ApiResult;
import cc.uncarbon.module.appapi.constant.AppApiConstant;
import cc.uncarbon.module.appapi.model.vo.StaffVO;
import cc.uncarbon.module.appapi.service.StaffService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.websocket.server.PathParam;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.time.LocalDate;
import java.util.List;

@Tag(name = "小程序用户端美容师管理")
@RequestMapping(AppApiConstant.HTTP_API_URL_PREFIX + "/api/v1")
@RequiredArgsConstructor
@RestController
@Slf4j
public class StaffController {

    private final StaffService staffService;

    @Operation(summary = "可约美容师列表")
    @GetMapping("/staff/list")
    public ApiResult<List<StaffVO> > getList(@RequestParam("storeId") Long storeId) {
        return ApiResult.data(staffService.getStaffListByStoreId(storeId));
    }


    @Operation(summary = "美容师可约时间")
    @GetMapping("/staff/day")
    public ApiResult getDayTime(){
        return ApiResult.data(staffService.getDayTime());
    }

    @Operation(summary = "美容师可约时间")
    @GetMapping("/staff/day/time")
    public ApiResult getStaffDayTime(@RequestParam Long storeId, Long staffId , String date){
        return ApiResult.data(staffService.getStaffDayTime(storeId,staffId,date));
    }

}
